 /**
 * DISCLIMER: 
 * this library is an opensource, feel free to edit or redistribute it
 * but use it with you own risk
 * 
 * ktutnik
 */
package org.ticlib.events
{
	import flash.events.Event;
	
	public class NotificationEvent extends Event
	{
		public static const SHOW:String = "notificationShow";
		public static const TYPE_INFORMATION:String = "confirmationInformation";
		public static const TYPE_ERROR:String = "confirmationError";
		public static const TYPE_WARNING:String = "confirmationWarning";
		
		public var message:String;
		public var messageType:String;
		
		public function NotificationEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
		}
		
		public static function info(message:String):NotificationEvent
		{
			var e:NotificationEvent = new NotificationEvent(NotificationEvent.SHOW, true);
			e.messageType = TYPE_INFORMATION;
			e.message = message;
			return e;
		}
		
		public static function warning(message:String):NotificationEvent
		{
			var e:NotificationEvent = new NotificationEvent(NotificationEvent.SHOW, true);
			e.messageType = TYPE_WARNING;
			e.message = message;
			return e;
		}
		
		public static function error(message:String):NotificationEvent
		{
			var e:NotificationEvent = new NotificationEvent(NotificationEvent.SHOW, true);
			e.messageType = TYPE_ERROR;
			e.message = message;
			return e;
		}
	}
}